<!--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html>
<head>
    <title>Glance Design Dashboard an Admin Panel Category Flat Bootstrap Responsive Website Template | SignUp Page ::
        w3layouts</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content=""/>
    <script type="application/x-javascript"> addEventListener("load", function () {
        setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>

    <!-- Bootstrap Core CSS -->
    <link href="static/css/bootstrap.css" rel='stylesheet' type='text/css'/>

    <!-- Custom CSS -->
    <link href="static/css/style.css" rel='stylesheet' type='text/css'/>

    <!-- font-awesome icons CSS -->
    <link href="static/css/font-awesome.css" rel="stylesheet">
    <!-- //font-awesome icons CSS -->

    <!-- side nav css file -->
    <link href='static/css/SidebarNav.min.css' media='all' rel='stylesheet' type='text/css'/>
    <!-- side nav css file -->

    <!-- js-->
    <script src="static/js/jquery-1.11.1.min.js"></script>
    <script src="static/js/modernizr.custom.js"></script>


    <!-- Metis Menu -->
    <script src="static/js/metisMenu.min.js"></script>
    <script src="static/js/custom.js"></script>
    <link href="static/css/custom.css" rel="stylesheet">
    <!--//Metis Menu -->

</head>
<body>
<div class="main-content">
    <!-- main content start-->
    <div id="page-wrapper">
        <div class="main-page signup-page">
            <h2 class="title1">注册页面</h2>
            <div class="sign-up-row widget-shadow">
                <form id="userForm">
                    <div class="sign-u">
                        <input type="text" name="username" placeholder="账号" required="">
                        <div class="clearfix"></div>
                    </div>
                    <div class="sign-u">
                        <input type="text" name="password" placeholder="密码" required="">
                        <div class="clearfix"></div>
                    </div>
                    <div class="sign-u" style="position: relative;">
                        <input type="email" name="email" style="width: 550px;" placeholder="邮箱" required="">
                        <div class="clearfix"></div>
						<button id="code" onclick="sendEmail()" class="btn btn-dark btn-block" style="width: 120px;height: 50px;position: absolute;top: 0px;right: 0px;" type="button">获取验证码</button>
                    </div>
					<div class="sign-u">
						<input type="text" name="code" placeholder="激活码" required="">
						<div class="clearfix"></div>
					</div>
                    <div class="sub_home">
                        <input type="button" id="btn" value="注册">
                        <div class="clearfix"></div>
                    </div>
                    <div class="registration">
						已有账号，开始登录
                        <a class="" href="login.html">
                            登录
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!--footer-->
    <div class="footer">
        <p>&copy; 2021 版权解释权归本公司所有 | 哈哈哈 <a href="" target="_blank">LaiXueIT</a></p>
    </div>
    <!--//footer-->
</div>

<!-- side nav js -->
<script src='static/js/SidebarNav.min.js' type='text/javascript'></script>
<script>
    $('.sidebar-menu').SidebarNav()

    function sendEmail(){
        let email = $("input[name=email]").val()
        /*$.get('/schoolmanager_war_exploded/user/sendmail?email='+email,function (data) {
            alert("邮件发送中，请稍等")
        })*/

        $.ajax({
            url:'/schoolmanager_war_exploded/user/sendmail?email='+email,
            datatype:"json",
            beforeSend:function(){
                alert("邮件发送中，请稍等")
            },
            success:function (data) {
                if(data){
                    alert("邮件发送成功，请查收")
                }
            }
        })
    }

    $(function () {
        $("#btn").click(function () {
            var user  =  $("#userForm").serialize()
            $.ajax({
                url:'/schoolmanager_war_exploded/user/addUser',
                data:user,
                datatype:"json",
                type:"post",
                async:false,
                success:function (data) {
                    if(data){
                        location.href='login.html'
                    }else {
                        alert("注册失败")
                    }
                }
            })
        })
    })

</script>
<!-- //side nav js -->

<!-- Classie --><!-- for toggle left push menu script -->
<script src="static/js/classie.js"></script>
<script>
    var menuLeft = document.getElementById('cbp-spmenu-s1'),
        showLeftPush = document.getElementById('showLeftPush'),
        body = document.body;

    showLeftPush.onclick = function () {
        classie.toggle(this, 'active');
        classie.toggle(body, 'cbp-spmenu-push-toright');
        classie.toggle(menuLeft, 'cbp-spmenu-open');
        disableOther('showLeftPush');
    };

    function disableOther(button) {
        if (button !== 'showLeftPush') {
            classie.toggle(showLeftPush, 'disabled');
        }
    }
</script>
<!-- //Classie --><!-- //for toggle left push menu script -->

<!--scrolling js-->
<script src="static/js/jquery.nicescroll.js"></script>
<script src="static/js/scripts.js"></script>
<!--//scrolling js-->

<!-- Bootstrap Core JavaScript -->
<script src="static/js/bootstrap.js"></script>

</body>
</html>